//
// Created by zuo on 2024/7/7.
// 题目链接 https://www.lanqiao.cn/problems/3291/learning/?page=1&first_category_id=1&problem_id=3291
// 题目链接 https://www.lanqiao.cn/problems/1276/learning/?page=1&first_category_id=1&name=%E5%B0%8F%E6%98%8E%E7%9A%84%E5%BD%A9%E7%81%AF
//

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 1e5 + 3;
ll a[N], d[N];

int main()
{
    // int n, m;
    // while (cin >> n >> m)
    // {
    //     for (int i = 1; i <= n; i++) cin >> a[i];
    //     for (int i = 1; i <= n; i++) d[i] = a[i] - a[i - 1]; // 差分数组
    //
    //     while (m--)
    //     {
    //         int x, y, z;
    //         cin >> x >> y >> z;
    //         // 修改区间  x~y的数据   固定下列写法
    //         d[x] += z;
    //         d[y + 1] -= z;
    //     }
    //
    //     // 前缀和还原
    //     for (int i = 1; i <= n; i++) a[i] = a[i - 1] + d[i];
    //     for (int i = 1; i <= n; i++) cout << a[i] << " \n"[i == n];
    // }

    int n, q;
    cin >> n >> q;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= n; i++) d[i] = a[i] - a[i - 1]; // 差分

    while (q--)
    {
        ll l, r, x;
        cin >> l >> r >> x;
        // 修改区间的固定写法
        d[l] += x;
        d[r + 1] -= x;
    }

    // 前缀和 用来修改区间  配合上面的修改固定写法
    for (int j = 1; j <= n; j++) a[j] = a[j - 1] + d[j];
    for (int i = 1; i <= n; i++) cout << (a[i] > 0 ? a[i] : 0) << " \n"[i == n];

    return 0;
}
